import request from '/@/utils/request';
import { paramsSerializer } from '/@/utils/sort';

// 列表
export const pictureList = (params?: object) => {
  return request({
    url: 'api/v1/admins/picture',
    method: 'get',
    params,
    paramsSerializer
  })
}

// 详情
export const pictureDetail = (id: number) => {
  return request({
    url: `api/v1/admins/picture/${id}`,
    method: 'get',
  })
}

// 新增
export const addPicture = (data: Object) => {
  return request({
    url: `api/v1/admins/picture`,
    method: 'post',
    data
  })
}

// 修改
export const updatePicture = (data: Object) => {
  return request({
    url: `api/v1/admins/picture`,
    method: 'put',
    data
  })
}

// 删除
export const deletePicture = (id: number) => {
  return request({
    url: `api/v1/admins/picture/${id}`,
    method: 'delete'
  })
}